package com.zbkj.admin.controller.publicly;

import com.zbkj.admin.model.req.SFExpressCloudPrintWaybills;
import com.zbkj.admin.model.req.SFExpressOrderState;
import com.zbkj.admin.model.req.SFExpressPickCodeVerifyReq;
import com.zbkj.admin.model.req.SFExpressRouteSubscribeReq;
import com.zbkj.admin.model.vo.SFExpressPickCodeVerifyVo;
import com.zbkj.admin.service.SFExpressOrderStateService;
import com.zbkj.admin.service.SFExpressRouteService;
import com.zbkj.admin.vo.SFExpressOrderStateVo;
import com.zbkj.admin.vo.SFExpressRouteVo;
import com.zbkj.dal.annotation.CustomResponseAnnotation;
import com.zbkj.dal.common.utils.JsonUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("api/publicly/express")
public class SFExpressRouteController {

    @Autowired
    private SFExpressRouteService sfExpressRouteService;
    @Autowired
    private SFExpressOrderStateService sfExpressOrderStateService;

    @CustomResponseAnnotation
    @PostMapping("/sf/route/subscribe")
    @ApiOperation(value = "对外接口 - 顺丰物流订阅", tags = "物流订阅")
    public SFExpressRouteVo sfRouteSubscribe(@RequestBody SFExpressRouteSubscribeReq req) {
        return sfExpressRouteService.sfRouteSubscribe(req);
    }

    @CustomResponseAnnotation
    @PostMapping("/sf/order-state")
    @ApiOperation(value = "对外接口 - 订单状态通知", tags = "物流订阅")
    public SFExpressOrderStateVo sfOrderStateAccept(@RequestBody SFExpressOrderState req) {
        // 订单状态通知， 这里有很多种订单状态，要做不同的处理
        return sfExpressOrderStateService.accept(req);
    }

    @CustomResponseAnnotation
    @PostMapping("/sf/cloud-print-waybills/pdf")
    @ApiOperation(value = "对外接口 - 云打印面单转PDF接口", tags = "物流订阅")
    public SFExpressOrderStateVo sfCloudPrintWaybillsPdf(SFExpressCloudPrintWaybills req) {
        return sfExpressOrderStateService.sfCloudPrintWaybillsPdf(req);
    }

    @CustomResponseAnnotation
    @PostMapping("/sf/cloud-print-waybills/html")
    @ApiOperation(value = "对外接口 - 云打印面单转PDF接口", tags = "物流订阅")
    public SFExpressOrderStateVo sfPrintingLabelCloudToHtml(@RequestBody SFExpressOrderState req) {
        // 订单状态通知， 这里有很多种订单状态，要做不同的处理
        return sfExpressOrderStateService.accept(req);
    }
}
